package com.ayf.payment.game.api.service.impl;

import com.ayf.payment.game.api.dto.OrderSplitDTO;
import com.ayf.payment.game.api.entity.OrderSplit;
import com.ayf.payment.game.api.mapper.OrderSplitMapper;
import com.ayf.payment.game.api.service.OrderSplitService;
import com.swwx.charm.commons.lang.utils.BeanConvertUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class OrderSplitServiceImpl implements OrderSplitService {

    @Resource
    private OrderSplitMapper orderSplitMapper;
    @Override
    public List<OrderSplitDTO> getOrderSplitsByOrderId(String orderId) {
        return orderSplitMapper.getOrderSplitsByOrderId(orderId);
    }

    @Override
    public void insertOrderSplit(OrderSplitDTO item) {
        orderSplitMapper.insertSelective(BeanConvertUtils.convert(item,OrderSplit.class));
    }
}
